﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Microsoft.Extensions.DependencyInjection;

using Xc.DataAccess.OneNetCore.Services;

namespace Microsoft.Extensions.DependencyInjection
{
    public static class ApplicationExtension
    {
        /// <summary>
        /// 添加OneNet服务
        /// </summary>
        /// <param name="serviceDescriptors"></param>
        /// <returns></returns>
        public static IServiceCollection AddOneNetService(this IServiceCollection serviceDescriptors)
        {
            serviceDescriptors.AddConverterService();
            serviceDescriptors.AddHttpClient();
            serviceDescriptors.AddTransient<IOneNetService, OneNetService>();
            return serviceDescriptors;
        }
    }
}
